<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
<?Php

    $pref = preferences::getInstance();
    $loginData = $pref -> getProperty ( 'loginData' );
    $messageString = $pref -> getProperty('messageString');
    $rootPath = $pref -> getProperty('rootPath');

?>

    <title><?=SITE_TITLE;?></title>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <META http-equiv="Pragma" content="no-cache">
    <META NAME="Description" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    
    <link href="<?=$rootPath;?>/scripts/reset.css" rel="stylesheet" type="text/css" />
    <link href="<?=$rootPath;?>/scripts/style.css" rel="stylesheet" type="text/css" />
    <script src="<?=$rootPath;?>/scripts/scripts.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
    
</head>

<body>
    <noscript style="color: red"><b>Для работы сайта требуется JavaScript!</b></noscript>
	<div id="upload_overlay" style="display: none;"></div>
	<div id="popup" style="display: none;"></div>
	<div id="hintdiv" style="display: none;"></div>
	
	<div id="logintab" style="display: none;">
	    <span style="font-size: 20px; padding: 5px;">Вход на сайт</span>
	    <div style="float: right; text-decoration: underline; cursor: pointer;" onclick="hideLoginTab();">закрыть</div>
	    <BR><BR>
	    <table border=0>
	      <tr>
		<td valign=top>
		<form action="<?=$rootPath;?>/" method="POST">
		<input type="hidden" name="action" value="login">
		<input type="hidden" name="urltogo" id="urltogo" value="<?=$_SERVER['REQUEST_URI'];?>">
		<input type="hidden" name="ref" value="true">
		  <div style="padding: 5px;">логин</div>
		  <input class="feartext" name="username" id="loginemail" title="логин и пароль такие же, как на russianplanes.net"><BR>
		  <div style="padding: 5px;">пароль</div>
		  <input class="feartext" name="password" id="loginpass" type="password" title="логин и пароль такие же, как на russianplanes.net">
		  <BR>
		  <BR>
		  <input class="feartext" style="width: 190px; border: 2px solid black;" type="submit" value="Вход">
		    <BR>
		</form>
		</td>
	      </tr>
	    </table>
	</div>


    <div id="header">
	
	<div id="title"><img src="/scripts/_imgs/logo.png"></div>
	
	<div id="contact">
	<?Php
	
	    
	    if ($messageString)echo "<script>alert ('".$messageString."');</script>";
	    if ($loginData['account']>0){
		
		echo '<span style="color: #333333;">логин: <b>' . $loginData['priv']['email'] . '</b> &middot; </span>';
		if ($loginData['priv']['privileges']>1)echo '<a href="'.$rootPath.'/admin" class="thic">панель управления</a> &middot; ';
		echo '<a href="'.$rootPath.'/?action=logout" class="thic">выход</a>';
	    }
	    else
	    echo '<a onClick="showLoginTab(); return false;" class="thic" style="border-bottom: 1px dotted; cursor: pointer;">вход на сайт</a>';
	?>
	</div>
	
	<div id="slogan"></div>
    
    </div>
    
    <div id="nav">
	<?
	    foreach($data['menu'][0] as $v){
		$sted = ''; if ($page['id']==$v['id'])$sted='class="selected"';
		$v['title'] = str_replace(' ','&nbsp',$v['title']);
		echo "<a href='{$rootPath}/{$v['url']}' {$sted}>{$v['title']}</a> ";
	    }
	?>
    </div>
    
    <div id="content">
	
    <?Php

	//echo '<div id="maincontent">';
	echo '<div>';
	
	if ($page['header'])echo '<h1>'.$page['header'].'</h1> ';
	else echo '<BR>';
    
    ?>